# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
#
# Kernel module implementing a test suite for testing KTF itself
#

ccflags-y += -Wno-vla

KVER = @KVER@
KTF_DIR = @KTF_DIR@
KTF_BDIR = @KTF_BDIR@

ccflags-y += -I$(KTF_DIR)

obj-m := selftest.o

-include ktf_gen.mk

selftest-y := self.o hybrid.o context.o

KDIR   := @KDIR@
PWD    := $(shell pwd)

EXTRASYMS := KBUILD_EXTRA_SYMBOLS="$(KTF_BDIR)/Module.symvers"

module:
	$(MAKE) -C $(KDIR) M=$(PWD) $(EXTRASYMS) modules

modules_install:
	$(MAKE) -C $(KDIR) M=$(PWD) $(EXTRASYMS) modules_install

clean:
	$(MAKE) -C $(KDIR) M=$(PWD) clean

check: all
	$(MAKE) -C $(KDIR) M=$(PWD) C=2
